<template>
	<view class="list-box">
		<view v-if="stuList.length==0" style="text-align: center;">
					<image src="../../static/nodata.png" class="nodata_img" ></image>
		</view>
		<view class="list-box-content">
			<view class="list-box-info zhengwen1" @click="tongjixiangqing(iterm.sno)" v-for="(iterm,index) in stuList" :key="index" >
				<view class="s-name">
					{{iterm.name}}
				</view>
				<view class="s-number">
					学号：{{iterm.sno}}
				</view>
				<view class="s-text">
					统计信息&nbsp;&nbsp;》
				</view>
			</view>
		
		</view>
		
	</view>
</template>

<script>
	export default{
		props:["classId"],
		data(){
			return{
				sno:'0000000001',
				stuList:[]
			}
		},
		created() {
			this.reloadRequest();
		},
		methods:{
			reloadRequest() {
				let _this = this;
				//提交数据请求接口
				uni.request({
					url: this.baseUrl + "/secretary/sum/searchStudentsList?satoken="+uni.getStorageSync('satoken'),
					data: {
						classId: this.classId,
						current: 1,
						size: 10
					},
					withCredentials: true,
					headers: {
						//"content-type": "application/x-www-form-urlencoded",
						// token: localStorage.getItem('token')
					},
					success: res => { 
						console.log(res.data.data.records);
						this.stuList=res.data.data.records
					}
				}); 
			},
			
			tongjixiangqing(sno){
				uni.navigateTo({
					url: '/pages/tongjixiangqing/tongjixiangqing?sno='+sno
				});
			}
		}
	}
</script>

<style lang="scss">
	@import url(@/static/common.css);
	.list-box{
		width: 100%;
		box-sizing: border-box;
		overflow: hidden;
		.list-box-content{
			width: 95%;
			margin: 0 auto;
			box-sizing: border-box;
			overflow: hidden;
			display: flex;
			flex-direction: column;
			.list-box-info{
				width: 100%;
				box-sizing: border-box;
				overflow: hidden;
				display: flex;
				flex-direction: row;
				padding: 20rpx 0;
				border-bottom: 1rpx solid #999999;
				.s-name{
					flex: 1;
				}
				.s-number{
					flex: 2;
				}
				.s-text{
					flex: 1;
				}
			}
		}
	}
</style>